﻿using System.Collections;
using System.Data.Common;

namespace System.Data.Linq.SqlClient
{
    internal interface IObjectReader : IEnumerator, IDisposable
    {
        // Properties
        IObjectReaderSession Session { get; }
    }

    internal interface IObjectReaderSession : IConnectionUser, IDisposable
    {
        // Methods
        void Buffer();

        // Properties
        bool IsBuffered { get; }
    }

    internal interface IObjectReaderFactory
    {
        // Methods
        IObjectReader Create(DbDataReader reader, bool disposeReader, IReaderProvider provider, object[] parentArgs, object[] userArgs, ICompiledSubQuery[] subQueries);
        IObjectReader GetNextResult(IObjectReaderSession session, bool disposeReader);
    }

    internal interface IObjectReaderCompiler
    {
        // Methods
        IObjectReaderFactory Compile(SqlExpression expression, Type elementType);
        IObjectReaderSession CreateSession(DbDataReader reader, IReaderProvider provider, object[] parentArgs, object[] userArgs, ICompiledSubQuery[] subQueries);
    }


}
